dist: Add a dist script to generate css
authorMatthias Clasen <mclasen@redhat.com>
Tue, 12 Jan 2021 13:18:47 +0000 (08:18 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 12 Jan 2021 13:42:18 +0000 (08:42 -0500)
When I added the sassc option, I failed to ensure that
the theme css is included in the tarballs. This is required
to make tarball builds with -Dsassc=disabled work.

build-aux/meson/dist-theme.py [new file with mode: 0644]
meson.build

diff --git a/build-aux/meson/dist-theme.py b/build-aux/meson/dist-theme.py
new file mode 100644 (file)
index 0000000..1582057
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+import os
+from pathlib import PurePath
+import subprocess
+
+stylesheets = [ 'gtk/theme/Adwaita/Adwaita.css',
+                'gtk/theme/Adwaita/Adwaita-dark.css',
+                'gtk/theme/HighContrast/HighContrast.css',
+                'gtk/theme/HighContrast/HighContrast-inverse.css' ]
+
+sourceroot = os.environ.get('MESON_SOURCE_ROOT')
+distroot = os.environ.get('MESON_DIST_ROOT')
+
+for stylesheet in stylesheets:
+  stylesheet_path = PurePath(stylesheet)
+  src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
+  dst = PurePath(distroot, stylesheet_path)
+  subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst])
index 9fe9cd5acf81af6c36ecf42015da4ea783d2ae6d..3edb716efc4a8cc27c5d9909a7f79cd1498fda07 100644 (file)
@@ -803,6 +803,8 @@ else
   message('Not executing post-install steps automatically when cross compiling')
 endif
 
+meson.add_dist_script('build-aux/meson/dist-theme.py')
+
 if host_machine.system() != 'windows'
   # Install Valgrind suppression files (except on Windows,
   # as Valgrind is currently not supported on Windows)